package com.a16.yuejian.yuejian.service;

import com.a16.yuejian.yuejian.javabean.Comment;
import com.a16.yuejian.yuejian.javabean.Post;
import com.a16.yuejian.yuejian.javabean.Success;

import java.util.List;

import okhttp3.MultipartBody;
import retrofit2.Call;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.Query;

/**
 * Created by 王子恒 on 2017/10/25.
 */

public interface PostService {
    @GET("index.php/api/post/allpost")
    Call<List<Post>> allpost(

    );

    @GET("index.php/api/post/getcomment")
    Call<List<Comment>> getcomment(
      @Query("postid") String postid
    );

    @GET("index.php/api/post/comment")
    Call<Success> comment(
      @Query("userid") String userid,
      @Query("content") String content,
      @Query("postid") String postid
    );


    @GET("index.php/api/post/getuserpost")
    Call<List<Post>> getuserpost(
            @Query("userid") String userid
    );

    @Multipart
    @POST("index.php/api/post/send")
    Call<Success> send(
            @Query("userid") String userid,
            @Query("content") String content,
            @Part MultipartBody.Part file
    );
}
